package cn.itcast.controller;


import cn.itcast.constant.MessageConstant;
import cn.itcast.entity.Result;
import cn.itcast.pojo.Address;
import cn.itcast.service.AddressService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/address")
@RestController
public class AddressFindAll {

    @Reference
    private AddressService addressService;

    /**
     * 查询所有分院信息
     * @return
     */
    @GetMapping("/findAll")
    public Result findAll(){
        List<Address> addressList = addressService.findAll();
        return new Result(true, MessageConstant.ADD_CHECKGROUP_SUCCESS,addressList);
    }
}
